﻿<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:local="clr-namespace:SCSFContrib.CompositeUI.Converters"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Classic"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2006"
	mc:Ignorable="d">

	<!-- Animations -->
	<Storyboard x:Key="FadeInAnimation">
		<DoubleAnimation Storyboard.TargetProperty="Opacity" To="0.9" Duration="0:0:0.5" />
	</Storyboard>

	<Storyboard x:Key="FadeOutAnimation">
		<DoubleAnimation Storyboard.TargetProperty="Opacity" To="0.3" Duration="0:0:0.5" />
	</Storyboard>
	
	<Storyboard x:Key="BorderThicknessAnimation">
			<ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="BorderThickness" RepeatBehavior="Forever" AutoReverse="True">
				<SplineThicknessKeyFrame KeyTime="00:00:00" Value="3,3,3,3"/>
				<SplineThicknessKeyFrame KeyTime="00:00:01" Value="2,2,2,2"/>
			</ThicknessAnimationUsingKeyFrames>
		</Storyboard>

	<!-- End Animations -->
	
	<!-- scroll viewer -->
	<Style x:Key="ScrollViewerStyle" TargetType="{x:Type ScrollViewer}">
		<Setter Property="HorizontalScrollBarVisibility" Value="Auto" />
		<Setter Property="VerticalScrollBarVisibility" Value="Auto" />
	</Style>

	<!-- zoom area -->
	<Style x:Key="ZoomAreaStyle" TargetType="{x:Type StackPanel}">
		<Setter Property="Opacity" Value=".3" />
		<Setter Property="HorizontalAlignment" Value="Right" />
		<Setter Property="VerticalAlignment" Value="Bottom" />
		<Setter Property="Margin" Value="15" />
		<Style.Triggers>
			<EventTrigger RoutedEvent="MouseEnter">
				<EventTrigger.Actions>
					<BeginStoryboard Storyboard="{StaticResource FadeInAnimation}" />
				</EventTrigger.Actions>
			</EventTrigger>
			<EventTrigger RoutedEvent="MouseLeave">
				<EventTrigger.Actions>
					<BeginStoryboard Storyboard="{StaticResource FadeOutAnimation}" />
				</EventTrigger.Actions>
			</EventTrigger>
		</Style.Triggers>
	</Style>

	<!-- zoom slider -->
	<Style x:Key="ZoomSliderStyle" TargetType="{x:Type Slider}">
		<Setter Property="Width" Value="70" />
		<Setter Property="Height" Value="20" />
		<Setter Property="Cursor" Value="Arrow" />
		<Setter Property="Orientation" Value="Horizontal" />
		<Setter Property="TickPlacement" Value="None" />
		<Setter Property="SmallChange" Value="0.1" />
		<Setter Property="LargeChange" Value=".5" />
		<Setter Property="Maximum" Value="10" />
		<Setter Property="Minimum" Value=".5" />
		<Setter Property="IsSnapToTickEnabled" Value="False" />
	</Style>

	<!-- zoom label -->
	<Style x:Key="ZoomLabelStyle" TargetType="{x:Type Label}">
		<Setter Property="HorizontalAlignment" Value="Center" />
		<Setter Property="Foreground" Value="White" />
	</Style>

	<!-- slider border -->
	<Style x:Key="SliderBorderStyle" TargetType="{x:Type Border}">
		<Setter Property="BorderThickness" Value="0" />
		<Setter Property="CornerRadius" Value="10" />
		<Setter Property="Background" Value="#80000000" />
		<Setter Property="BorderBrush" Value="#80ffffff" />
		<Setter Property="Padding" Value="7" />
	</Style>

	<!-- Backgrounds definitions. -->
	
	<LinearGradientBrush x:Key="DefaultBackground" EndPoint="1,0.5" StartPoint="0,0.5">
    <GradientStop Color="#FF555555" Offset="0"/>
    <GradientStop Color="#FF292929" Offset="1"/>
  </LinearGradientBrush>

	<LinearGradientBrush x:Key="WorkspaceBackground" EndPoint="1,0.5" StartPoint="0,0.5">
		<GradientStop Color="#FF56919F" Offset="0"/>
		<GradientStop Color="#FF02A8CE" Offset="1"/>
	</LinearGradientBrush>

	<LinearGradientBrush x:Key="ItemBackground" EndPoint="1,0.5" StartPoint="0,0.5">
		<GradientStop Color="#FF569F69" Offset="0"/>
		<GradientStop Color="#FF04D00A" Offset="1"/>
	</LinearGradientBrush>

	<LinearGradientBrush x:Key="EventTopicBackground" EndPoint="1,0.5" StartPoint="0,0.5">
		<GradientStop Color="#FF8A569F" Offset="0"/>
		<GradientStop Color="#FF6D02CE" Offset="1"/>
	</LinearGradientBrush>

	<LinearGradientBrush x:Key="ServiceBackground" EndPoint="1,0.5" StartPoint="0,0.5">
		<GradientStop Color="#FF9F6356" Offset="0"/>
		<GradientStop Color="#FFCE3102" Offset="1"/>
	</LinearGradientBrush>

	<LinearGradientBrush x:Key="SmartPartBackground" EndPoint="1,0.5" StartPoint="0,0.5">
		<GradientStop Color="#FFD2C378" Offset="0"/>
		<GradientStop Color="#FFE9D80C" Offset="1"/>
	</LinearGradientBrush>
  
	<LinearGradientBrush x:Key="AlternativeBackground" StartPoint="1,-2" EndPoint="0,2">
		<GradientStop Color="#DAEEF3" Offset="0.3"/>
		<GradientStop Color="#92CDDC" Offset="0.5"/>
		<GradientStop Color="#DAEEF3" Offset="0.7"/>
	</LinearGradientBrush>

	<LinearGradientBrush x:Key="ActiveBackground" StartPoint="1,-2" EndPoint="0,2">
		<GradientStop Color="#FFFFE000" Offset="0.3"/>
		<GradientStop Color="#FF9A7900" Offset="0.5"/>
		<GradientStop Color="#FFFFEB00" Offset="0.7"/>
	</LinearGradientBrush>
	
	<LinearGradientBrush x:Key="RedBackground" EndPoint="0.501,0.039" StartPoint="0.501,0.971">
		<GradientStop Color="#FF860E0E" Offset="0.101"/>
        <GradientStop Color="#FF9C0F0F" Offset="0.49"/>
       	<GradientStop Color="#FFD17575" Offset="0.51"/>
       	<GradientStop Color="#FFA41313" Offset="0"/>
        <GradientStop Color="#FFD57777" Offset="0.986"/>
    </LinearGradientBrush>

	<!-- End Backgrounds definitions. -->
	
	<!-- Font -->
	<Style x:Key = "DefaultFont" >
		<Setter Property="TextBlock.Foreground" Value="White" />
		<Setter Property="TextBlock.FontFamily" Value="Calibri"/>
		<Setter Property="TextBlock.FontSize" Value="11"/>
	</Style>
	<Style x:Key = "DefaultBoldFont" BasedOn="{StaticResource DefaultFont}">
		<Setter Property="TextBlock.FontWeight" Value="Bold" />
		<Setter Property="TextBlock.Foreground" Value="Yellow"/>
		<Setter Property="TextBlock.FontSize" Value="12"/>
	</Style>
	<!-- End Font -->

	<!-- Borders -->
	
	<Style x:Key ="BorderBaseStyle" TargetType="{x:Type Border}">
		<Setter Property="CornerRadius" Value="10"></Setter>
		<Setter Property="Padding" Value="10"></Setter>
		<Setter Property="MinWidth" Value="100"></Setter>
		<Setter Property="VerticalAlignment" Value="Center"></Setter>
		<Setter Property="HorizontalAlignment" Value="Center"></Setter>
		<Setter Property="BorderThickness" Value="1"></Setter>
		<Setter Property="BorderBrush" Value="Black"></Setter>
	</Style>

	<Style x:Key="ActiveBorderStyle" TargetType="{x:Type Border}" BasedOn="{StaticResource BorderBaseStyle}">
		<Setter Property="BorderBrush" Value="Yellow"></Setter>
		<Setter Property="BorderThickness" Value="2"></Setter>
		<Setter Property="Background" Value="{StaticResource DefaultBackground}"></Setter>
		<Setter Property="TextBlock.Foreground" Value="White" />
	</Style>

	<Style x:Key="DefaultBorderStyle" TargetType="{x:Type Border}" BasedOn="{StaticResource BorderBaseStyle}">
		<Setter Property="Background" Value="{StaticResource DefaultBackground}"></Setter>
		<Setter Property="TextBlock.Foreground" Value="White" />
	</Style>

	<Style x:Key="WorkspaceBorderStyle" TargetType="{x:Type Border}" BasedOn="{StaticResource BorderBaseStyle}">
		<Setter Property="Background" Value="{StaticResource WorkspaceBackground}"></Setter>
		<Setter Property="TextBlock.Foreground" Value="White" />
	</Style>

	<Style x:Key="ItemBorderStyle" TargetType="{x:Type Border}" BasedOn="{StaticResource BorderBaseStyle}">
		<Setter Property="Background" Value="{StaticResource ItemBackground}"></Setter>
		<Setter Property="TextBlock.Foreground" Value="White" />
	</Style>
	
	<Style x:Key="ServiceBorderStyle" TargetType="{x:Type Border}" BasedOn="{StaticResource BorderBaseStyle}">
		<Setter Property="Background" Value="{StaticResource ServiceBackground}"></Setter>
		<Setter Property="TextBlock.Foreground" Value="White" />
	</Style>

	<Style x:Key="EventTopicBorderStyle" TargetType="{x:Type Border}" BasedOn="{StaticResource BorderBaseStyle}">
		<Setter Property="Background" Value="{StaticResource EventTopicBackground}"></Setter>
		<Setter Property="TextBlock.Foreground" Value="White" />
	</Style>

	<Style x:Key="SmartPartBorderStyle" TargetType="{x:Type Border}" BasedOn="{StaticResource BorderBaseStyle}">
		<Setter Property="Background" Value="{StaticResource SmartPartBackground}"></Setter>
		<Setter Property="TextBlock.Foreground" Value="White" />
	</Style>

	
	<!-- End Borders -->

	<!-- Expander -->

	<Style x:Key="ExpanderHeaderFocusVisual">
		<Setter Property="Control.Template">
			<Setter.Value>
				<ControlTemplate>
					<Border>
						<Rectangle SnapsToDevicePixels="true" Stroke="Black" StrokeDashArray="1 2" StrokeThickness="1" Margin="0"/>
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="ExpanderDownHeaderStyle" TargetType="{x:Type ToggleButton}">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ToggleButton}">
					<Border Padding="{TemplateBinding Padding}">
						<Grid SnapsToDevicePixels="False" Background="Transparent">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="19"/>
								<ColumnDefinition Width="*"/>
							</Grid.ColumnDefinitions>
							<Microsoft_Windows_Themes:ClassicBorderDecorator SnapsToDevicePixels="true" x:Name="Bd" VerticalAlignment="Top" Width="19" Height="19" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" BorderBrush="{x:Static Microsoft_Windows_Themes:ClassicBorderDecorator.ClassicBorderBrush}" BorderStyle="None" BorderThickness="1">
								<Path SnapsToDevicePixels="false" Stroke="{TemplateBinding Foreground}" StrokeThickness="1.5" HorizontalAlignment="Center" x:Name="arrow" VerticalAlignment="Center" Data="M 1,1.5 L 4.5,5 L 8,1.5"/>
							</Microsoft_Windows_Themes:ClassicBorderDecorator>
							<ContentPresenter SnapsToDevicePixels="True" HorizontalAlignment="Left" Margin="4,0,0,0" VerticalAlignment="Center" Grid.Column="1" RecognizesAccessKey="True"/>
						</Grid>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsChecked" Value="true">
							<Setter Property="Data" TargetName="arrow" Value="M 1,4.5  L 4.5,1  L 8,4.5"/>
						</Trigger>
						<Trigger Property="IsMouseOver" Value="true">
							<Setter Property="BorderStyle" TargetName="Bd" Value="ThinRaised"/>
						</Trigger>
						<Trigger Property="IsPressed" Value="true">
							<Setter Property="BorderStyle" TargetName="Bd" Value="ThinPressed"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="ExpanderRightHeaderStyle" TargetType="{x:Type ToggleButton}">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ToggleButton}">
					<Border Padding="{TemplateBinding Padding}">
						<Grid SnapsToDevicePixels="False" Background="Transparent">
							<Grid.RowDefinitions>
								<RowDefinition Height="19"/>
								<RowDefinition Height="*"/>
							</Grid.RowDefinitions>
							<Microsoft_Windows_Themes:ClassicBorderDecorator SnapsToDevicePixels="true" x:Name="Bd" Width="19" Height="19" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" BorderBrush="{x:Static Microsoft_Windows_Themes:ClassicBorderDecorator.ClassicBorderBrush}" BorderStyle="None" BorderThickness="1">
								<Path SnapsToDevicePixels="false" Stroke="{TemplateBinding Foreground}" StrokeThickness="1.5" HorizontalAlignment="Center" x:Name="arrow" VerticalAlignment="Center" Data="M 1,1.5 L 4.5,5 L 8,1.5">
									<Path.LayoutTransform>
										<RotateTransform Angle="-90"/>
									</Path.LayoutTransform>
								</Path>
							</Microsoft_Windows_Themes:ClassicBorderDecorator>
							<ContentPresenter SnapsToDevicePixels="True" HorizontalAlignment="Center" Margin="0,4,0,0" VerticalAlignment="Top" Grid.Row="1" RecognizesAccessKey="True"/>
						</Grid>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsChecked" Value="true">
							<Setter Property="Data" TargetName="arrow" Value="M 1,4.5  L 4.5,1  L 8,4.5"/>
						</Trigger>
						<Trigger Property="IsMouseOver" Value="true">
							<Setter Property="BorderStyle" TargetName="Bd" Value="ThinRaised"/>
						</Trigger>
						<Trigger Property="IsPressed" Value="true">
							<Setter Property="BorderStyle" TargetName="Bd" Value="ThinPressed"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="ExpanderUpHeaderStyle" TargetType="{x:Type ToggleButton}">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ToggleButton}">
					<Border Padding="{TemplateBinding Padding}">
						<Grid SnapsToDevicePixels="False" Background="Transparent">
							<Grid.ColumnDefinitions>
								<ColumnDefinition Width="19"/>
								<ColumnDefinition Width="*"/>
							</Grid.ColumnDefinitions>
							<Microsoft_Windows_Themes:ClassicBorderDecorator SnapsToDevicePixels="true" x:Name="Bd" Width="19" Height="19" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" BorderBrush="{x:Static Microsoft_Windows_Themes:ClassicBorderDecorator.ClassicBorderBrush}" BorderStyle="None" BorderThickness="1">
								<Path SnapsToDevicePixels="false" Stroke="{TemplateBinding Foreground}" StrokeThickness="1.5" HorizontalAlignment="Center" x:Name="arrow" VerticalAlignment="Center" Data="M 1,1.5 L 4.5,5 L 8,1.5">
									<Path.LayoutTransform>
										<RotateTransform Angle="180"/>
									</Path.LayoutTransform>
								</Path>
							</Microsoft_Windows_Themes:ClassicBorderDecorator>
							<ContentPresenter SnapsToDevicePixels="True" HorizontalAlignment="Left" Margin="4,0,0,0" VerticalAlignment="Center" Grid.Column="1" RecognizesAccessKey="True"/>
						</Grid>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsChecked" Value="true">
							<Setter Property="Data" TargetName="arrow" Value="M 1,4.5  L 4.5,1  L 8,4.5"/>
						</Trigger>
						<Trigger Property="IsMouseOver" Value="true">
							<Setter Property="BorderStyle" TargetName="Bd" Value="ThinRaised"/>
						</Trigger>
						<Trigger Property="IsPressed" Value="true">
							<Setter Property="BorderStyle" TargetName="Bd" Value="ThinPressed"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="ExpanderLeftHeaderStyle" TargetType="{x:Type ToggleButton}">
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type ToggleButton}">
					<Border Padding="{TemplateBinding Padding}">
						<Grid SnapsToDevicePixels="False" Background="Transparent">
							<Grid.RowDefinitions>
								<RowDefinition Height="19"/>
								<RowDefinition Height="*"/>
							</Grid.RowDefinitions>
							<Microsoft_Windows_Themes:ClassicBorderDecorator SnapsToDevicePixels="true" x:Name="Bd" Width="19" Height="19" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" BorderBrush="{x:Static Microsoft_Windows_Themes:ClassicBorderDecorator.ClassicBorderBrush}" BorderStyle="None" BorderThickness="1">
								<Path SnapsToDevicePixels="false" Stroke="{TemplateBinding Foreground}" StrokeThickness="1.5" HorizontalAlignment="Center" x:Name="arrow" VerticalAlignment="Center" Data="M 1,1.5 L 4.5,5 L 8,1.5">
									<Path.LayoutTransform>
										<RotateTransform Angle="90"/>
									</Path.LayoutTransform>
								</Path>
							</Microsoft_Windows_Themes:ClassicBorderDecorator>
							<ContentPresenter SnapsToDevicePixels="True" HorizontalAlignment="Center" Margin="0,4,0,0" VerticalAlignment="Top" Grid.Row="1" RecognizesAccessKey="True"/>
						</Grid>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsChecked" Value="true">
							<Setter Property="Data" TargetName="arrow" Value="M 1,4.5  L 4.5,1  L 8,4.5"/>
						</Trigger>
						<Trigger Property="IsMouseOver" Value="true">
							<Setter Property="BorderStyle" TargetName="Bd" Value="ThinRaised"/>
						</Trigger>
						<Trigger Property="IsPressed" Value="true">
							<Setter Property="BorderStyle" TargetName="Bd" Value="ThinPressed"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	<Style x:Key="ExpanderStyle" TargetType="{x:Type Expander}">
		<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
		<Setter Property="Background" Value="Transparent"/>
		<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
		<Setter Property="VerticalContentAlignment" Value="Stretch"/>
		<Setter Property="BorderBrush" Value="Transparent"/>
		<Setter Property="BorderThickness" Value="1"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type Expander}">
					<Border SnapsToDevicePixels="true" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3">
						<DockPanel>
							<ToggleButton Background="{DynamicResource RedBackground}" FocusVisualStyle="{StaticResource ExpanderHeaderFocusVisual}" Margin="1" MinHeight="0" MinWidth="0" x:Name="HeaderSite" Style="{StaticResource ExpanderDownHeaderStyle}" Content="{TemplateBinding Header}" ContentTemplate="{TemplateBinding HeaderTemplate}" ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" FontFamily="{TemplateBinding FontFamily}" FontSize="{TemplateBinding FontSize}" FontStretch="{TemplateBinding FontStretch}" FontStyle="{TemplateBinding FontStyle}" FontWeight="{TemplateBinding FontWeight}" Foreground="{TemplateBinding Foreground}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" Padding="{TemplateBinding Padding}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" IsChecked="{Binding Path=IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" DockPanel.Dock="Top"/>
							<ContentPresenter Focusable="false" Visibility="Collapsed" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" x:Name="ExpandSite" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" DockPanel.Dock="Bottom"/>
						</DockPanel>
					</Border>
					<ControlTemplate.Triggers>
						<Trigger Property="IsExpanded" Value="true">
							<Setter Property="Visibility" TargetName="ExpandSite" Value="Visible"/>
						</Trigger>
						<Trigger Property="ExpandDirection" Value="Right">
							<Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Right"/>
							<Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Left"/>
							<Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderRightHeaderStyle}"/>
						</Trigger>
						<Trigger Property="ExpandDirection" Value="Up">
							<Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Top"/>
							<Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Bottom"/>
							<Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderUpHeaderStyle}"/>
						</Trigger>
						<Trigger Property="ExpandDirection" Value="Left">
							<Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Left"/>
							<Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Right"/>
							<Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderLeftHeaderStyle}"/>
						</Trigger>
						<Trigger Property="IsEnabled" Value="false">
							<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<!-- End Expander -->
	
	<!-- TreeView-->

	<Style x:Key="TreeViewStyle" TargetType="{x:Type TreeView}">
		<Setter Property="OverridesDefaultStyle" Value="True" />
		<Setter Property="SnapsToDevicePixels" Value="True" />
		<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
		<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type TreeView}">
					<Border
								  Name="Border"
								  CornerRadius="1"
								  BorderThickness="1" >
						<StackPanel Orientation="Horizontal" IsItemsHost="True"/>
					</Border>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<!-- TreeViewItem -->

	<Style x:Key="WorkItemTreeViewItemStyle" TargetType="{x:Type TreeViewItem}">
		<Setter Property="Background"
				  Value="Transparent"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="TreeViewItem">
					<Grid Margin="8,4">
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="Auto" />
						</Grid.ColumnDefinitions>
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto"/>
						</Grid.RowDefinitions>
						<Border Name="Bd"
						  BorderThickness="0.6"
						  CornerRadius="8"
						  Padding="6"
						  SnapsToDevicePixels="True"
						  Style="{StaticResource DefaultBorderStyle}"
						  Grid.Row="0"
						  Grid.Column="0">
							<Grid>
								<Expander Name="Expander" IsExpanded="{TemplateBinding TreeViewItem.IsExpanded}" Style="{StaticResource ExpanderStyle}">
									<Expander.Header>
										<Grid>
											<Grid.ColumnDefinitions>
												<ColumnDefinition Width="Auto" />
											</Grid.ColumnDefinitions>
											<Grid.RowDefinitions>
												<RowDefinition Height="4"></RowDefinition>
												<RowDefinition Height="Auto"></RowDefinition>
												<RowDefinition Height="7"></RowDefinition>
												<RowDefinition Height="Auto"></RowDefinition>
												<RowDefinition Height="Auto"></RowDefinition>
											</Grid.RowDefinitions>
											<ContentPresenter ContentSource="Header" Grid.Column="0" Grid.Row="1" Style="{StaticResource DefaultFont}"/>
											<TextBlock Text="{Binding Path=Type}" Grid.Column="0" Grid.Row="3" Style="{StaticResource DefaultFont}"></TextBlock>
											<TextBlock Text="{Binding Path=Assembly}" Grid.Column="0" Grid.Row="4" Style="{StaticResource DefaultFont}"></TextBlock>
										</Grid>
									</Expander.Header>
									<ItemsPresenter />
								</Expander>
								<ContentPresenter Name="ContentPresent"
								  ContentSource="Header"
								  HorizontalAlignment="Center"
								  VerticalAlignment="Center"
								  Visibility="Collapsed"
								  Style="{StaticResource DefaultFont}"/>
							</Grid>
						</Border>
					</Grid>
					<ControlTemplate.Triggers>
						<Trigger Property="TreeViewItem.HasItems" Value="false">
							<Setter
							  TargetName="Expander"
							  Property="Visibility"
							  Value="Collapsed" />
							<Setter
							  TargetName="ContentPresent"
							  Property="Visibility"
							  Value="Visible" />
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Setter Property="ItemsPanel">
			<Setter.Value>
				<ItemsPanelTemplate>
					<ItemsPanelTemplate.Resources>
						<local:ItemsOrientationConverter x:Key="converter" />
					</ItemsPanelTemplate.Resources>
					<StackPanel
					  IsItemsHost="True"
					  Orientation="{Binding 
              RelativeSource={x:Static RelativeSource.TemplatedParent}, 
              Converter={StaticResource converter}}"
            />
				</ItemsPanelTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style x:Key="DefaultTreeViewItemStyle" TargetType="{x:Type TreeViewItem}">
		<Setter Property="Background"
				  Value="Transparent"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="TreeViewItem">
					<Grid Margin="8,4">
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="Auto" />
						</Grid.ColumnDefinitions>
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto"/>
						</Grid.RowDefinitions>
						<Border Name="Bd"
						BorderThickness="0.6"
						CornerRadius="8"
						Padding="6"
						SnapsToDevicePixels="True"
						Style="{StaticResource DefaultBorderStyle}"
						Grid.Row="0"
						Grid.Column="0">
							<Grid>
								<Expander Name="Expander" IsExpanded="{TemplateBinding TreeViewItem.IsExpanded}" Style="{StaticResource ExpanderStyle}">
									<Expander.Header>
										<!--<ContentPresenter ContentSource="Header" Style="{StaticResource DefaultFont}" />-->

										<Grid>
											<Grid.ColumnDefinitions>
												<ColumnDefinition Width="Auto" />
											</Grid.ColumnDefinitions>
											<Grid.RowDefinitions>
												<RowDefinition Height="4"></RowDefinition>
												<RowDefinition Height="Auto"></RowDefinition>
												<RowDefinition Height="7"></RowDefinition>
												<RowDefinition Height="Auto"></RowDefinition>
												<RowDefinition Height="Auto"></RowDefinition>
											</Grid.RowDefinitions>
											<ContentPresenter ContentSource="Header" Grid.Column="0" Grid.Row="1" Style="{StaticResource DefaultFont}"/>
											<ContentControl Grid.Column="0" Grid.Row="3" Content="{Binding Path=Name}" Style="{StaticResource DefaultFont}"></ContentControl>
											<ContentControl Grid.Column="0" Grid.Row="4" Content="{Binding Path=Type}" Style="{StaticResource DefaultFont}"></ContentControl>
										</Grid>
									</Expander.Header>
									<ItemsPresenter />
								</Expander>
								<StackPanel>
									<ContentPresenter Name="ContentPresent"
									  ContentSource="Header"
									  HorizontalAlignment="Center"
									  VerticalAlignment="Center"
									  Visibility="Collapsed"
									  Style="{StaticResource DefaultFont}"/>
									<ContentControl Height="10"></ContentControl>
									<ContentControl Name="NameBlock" Visibility="Collapsed" Content="{Binding Path=Name}" Style="{StaticResource DefaultFont}"></ContentControl>
									<ContentControl Name="TypeBlock" Visibility="Collapsed" Content="{Binding Path=Type}" Style="{StaticResource DefaultFont}"></ContentControl>
								</StackPanel>
							</Grid>
						</Border>
					</Grid>
					<ControlTemplate.Triggers>
						<Trigger Property="TreeViewItem.Header" Value="Workspaces">
							<Setter
								TargetName="Bd"
								Property="Style"
								Value="{StaticResource WorkspaceBorderStyle}">
							</Setter>
						</Trigger>
						<Trigger Property="TreeViewItem.Header" Value="Items">
							<Setter
								TargetName="Bd"
								Property="Style"
								Value="{StaticResource ItemBorderStyle}">
							</Setter>
						</Trigger>
						<Trigger Property="TreeViewItem.Header" Value="Services">
							<Setter
								TargetName="Bd"
								Property="Style"
								Value="{StaticResource ServiceBorderStyle}">
							</Setter>
						</Trigger>
						<Trigger Property="TreeViewItem.Header" Value="Event Topics">
							<Setter
								TargetName="Bd"
								Property="Style"
								Value="{StaticResource EventTopicBorderStyle}">
							</Setter>
						</Trigger>
						<Trigger Property="TreeViewItem.Header" Value="SmartParts">
							<Setter
								TargetName="Bd"
								Property="Style"
								Value="{StaticResource SmartPartBorderStyle}">
							</Setter>
						</Trigger>
						<Trigger Property="TreeViewItem.HasItems" Value="false">
							<Setter
							  TargetName="Expander"
							  Property="Visibility"
							  Value="Collapsed" />
							<Setter
							  TargetName="ContentPresent"
							  Property="Visibility"
							  Value="Visible" />
							<Setter
							  TargetName="NameBlock"
							  Property="Visibility"
							  Value="Visible" />
							<Setter
							  TargetName="TypeBlock"
							  Property="Visibility"
							  Value="Visible" />
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>

	<Style x:Key="ActiveTreeViewItemStyle" TargetType="{x:Type TreeViewItem}">
		<Setter Property="Background"
				  Value="Transparent"/>
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="TreeViewItem">
					<Grid Margin="8,4">
						<Grid.ColumnDefinitions>
							<ColumnDefinition Width="Auto" />
							<ColumnDefinition Width="*" />
						</Grid.ColumnDefinitions>
						<Grid.RowDefinitions>
							<RowDefinition Height="Auto"/>
						</Grid.RowDefinitions>
						<Border Name="Bd"
						Padding="6"
						SnapsToDevicePixels="True"
						Style="{StaticResource ActiveBorderStyle}"
						Grid.Row="0"
						Grid.Column="0">
							<Grid>
								<Grid.ColumnDefinitions>
									<ColumnDefinition Width="Auto" />
									<ColumnDefinition Width="*" />
								</Grid.ColumnDefinitions>
								<Grid.RowDefinitions>
									<RowDefinition Height="Auto"/>
								</Grid.RowDefinitions>
								<Expander Name="Expander" IsExpanded="{TemplateBinding TreeViewItem.IsExpanded}" Style="{StaticResource ExpanderStyle}" Grid.Column="0" Grid.Row="0">
									<Expander.Header>
										<Grid>
											<Grid.ColumnDefinitions>
												<ColumnDefinition Width="Auto" />
												<ColumnDefinition Width="*" />
											</Grid.ColumnDefinitions>
											<Grid.RowDefinitions>
												<RowDefinition Height="4"></RowDefinition>
												<RowDefinition Height="Auto"></RowDefinition>
												<RowDefinition Height="7"></RowDefinition>
												<RowDefinition Height="Auto"></RowDefinition>
												<RowDefinition Height="Auto"></RowDefinition>
											</Grid.RowDefinitions>
											<ContentPresenter ContentSource="Header" Grid.Column="0" Grid.Row="1" Style="{StaticResource DefaultFont}"/>
											<TextBlock Text="{Binding Path=Type}" Grid.Column="0" Grid.Row="3" Style="{StaticResource DefaultFont}"/>
											<TextBlock Text="{Binding Path=Assembly}" Grid.Column="0" Grid.Row="4" Style="{StaticResource DefaultFont}"></TextBlock>
										</Grid>
									</Expander.Header>
									<ItemsPresenter />
								</Expander>
								<TextBlock Text="Active" Grid.Column="1" Grid.Row="0" Style="{StaticResource DefaultBoldFont}"/>
								<ContentPresenter Name="ContentPresent"
								  ContentSource="Header"
								  HorizontalAlignment="Center"
								  VerticalAlignment="Center"
								  Visibility="Collapsed"
								  Style="{StaticResource DefaultFont}"/>
							</Grid>
						</Border>
					</Grid>
					<ControlTemplate.Triggers>
						<Trigger Property="TreeViewItem.HasItems" Value="false">
							<Setter
							  TargetName="Expander"
							  Property="Visibility"
							  Value="Collapsed" />
							<Setter
							  TargetName="ContentPresent"
							  Property="Visibility"
							  Value="Visible" />
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
		<Setter Property="ItemsPanel">
			<Setter.Value>
				<ItemsPanelTemplate>
					<ItemsPanelTemplate.Resources>
						<local:ItemsOrientationConverter x:Key="converter" />
					</ItemsPanelTemplate.Resources>
					<StackPanel
					  IsItemsHost="True"
					  Orientation="{Binding 
              RelativeSource={x:Static RelativeSource.TemplatedParent}, 
              Converter={StaticResource converter}}"
            />
				</ItemsPanelTemplate>
			</Setter.Value>
		</Setter>
	</Style>
	
	<!-- End TreeViewItem-->

</ResourceDictionary>